<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>审核通知</title>
    <#assign base=request.contextPath  />
    <base id="basePath" href="${base}">
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css" media="all">
    <script src="${base}/frame/layui/layui.all.js" charset="utf-8"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <script type="text/javascript" src="${base}/wangEdit/wangEditor.min.js"></script>
    <style type="text/css">
        .layui-btn-radius {
            border-radius: 5px;
        }
    </style>
</head>
<body>
<form method="get" action="" id="myform" class="layui-form">
    <input type="hidden" id="id" value="${order.id}"/>
    <input type="hidden" id="userId"  value="${order.userId}"/>
    <input type="hidden" id="userList"  value="${order.userList}"/>
    <input type="hidden" id="noticeId"  value="${order.noticeId}"/>
    <br>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-inline">
                <textarea name="content" id="content" disabled value="" style="height: 200px;" lay-verify="required" autocomplete="off"
                          class="layui-input" type="text">${order.content}</textarea>
            </div>
        </div>
    </div>


    <div class="layui-form-item" style="text-align:center">
        <div class="layui-inline">
            <button class="layui-btn layui-btn-radius" lay-submit lay-filter="formDemo" type="button"
                  id="onSubmit" style="background-color: #28B779;">通过
            </button>
            <button class="layui-btn layui-btn-radius" id="error" lay-submit lay-filter="formDemo" type="button"  style="background-color: red">不通过</button>
        </div>
    </div>
</form>
<script>

    layui.use(['form', 'layedit', 'laydate', 'table', 'carousel'], function () {

        var carousel = layui.carousel;
        var form = layui.form
            , $ = layui.jquery
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , table = layui.table;
    });


</script>
<script>


    //通过
    $("#onSubmit").one("click",function(){

        var jsonDate = {};
        jsonDate.id = $("#id").val();
        jsonDate.userId = $("#userId").val();
        jsonDate.userList = $("#userList").val();
        jsonDate.content = $("#content").val();
        jsonDate.noticeId = $("#noticeId").val();
        $.ajax({
            type: "POST", //提交方式
            contentType: "application/json;charset=UTF-8",
            url: "${base}/admin/noticeOrder/success",
            data: JSON.stringify(jsonDate) ,
            success: function (data) {
                if (data.code === 0) {
                    layer.msg(data.msg)
                    setTimeout(function () {
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    }, 500)
                    var table = parent.layui.table;
                    //表刷新方法
                    table.reload('testReload', {
                        url: '${base}/admin/noticeOrder/selectMyPage'//数据接口
                        , where: {} //设定异步数据接口的额外参数
                    });
                } else {
                    layer.msg(data.msg)
                }
            }
        });
    })

    $("#error").one("click",function(){
        var jsonDate = {};
        jsonDate.id = $("#id").val();
        jsonDate.userId = $("#userId").val();
        jsonDate.content = $("#content").val();
        jsonDate.noticeId = $("#noticeId").val();
        $.ajax({
            type: "POST", //提交方式
            contentType: "application/json;charset=UTF-8",
            url: "${base}/admin/noticeOrder/error",
            data: JSON.stringify(jsonDate),
            success: function (data) {
                if (data.code === 0) {
                    layer.msg(data.msg)
                    setTimeout(function () {
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                    }, 500)
                    var table = parent.layui.table;
                    //表刷新方法
                    table.reload('testReload', {
                        url: '${base}/admin/noticeOrder/selectMyPage'//数据接口
                        , where: {} //设定异步数据接口的额外参数
                    });
                } else {
                    layer.msg(data.msg)
                }
            }
        });
    })


</script>

</body>
</html>